Skip to content

Catch up with Hookdeck's source types without breaking GitLab - #33

Merged
leggetter merged 2 commits into
mainfrom
fix/source-type-drift
Oct 22, 2026
Merged

leggetter merged 2 commits into
mainfrom
fix/source-type-drift

Conversation

@leggetter

@leggetter leggetter commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

The weekly Source type drift check has failed on every run since it was added on 17 August (9 failures, then a run on 19 October that hung in npm ci and was cancelled at the 6-hour limit). So the Source Type dropdown has been missing every platform Hookdeck added since: 151 types offered against 186 supported as of today.

I reproduced the failure locally before changing anything. It is real drift, not a quirk of the check: the generated file is byte-identical under en_US.UTF-8 and C.UTF-8, so the localeCompare sort is not the cause.

Why regenerating alone was wrong

Type main Plain regeneration This PR
GITLAB fields: ['api_key'] choice, so the node would refuse a GitLab Webhook Secret fields: ['api_key'], unchanged
SHIPSTATION fields: ['public_key'] none, so a source would never be verified keyless: the node sends auth: {}
AWS_SNS none: never verified none keyless: the node sends auth: {}
GOOGLE_PUBSUB not offered none, a misread $ref fields: ['audience', 'service_account_email']

GitLab gained auth_type: STANDARD_WEBHOOKS | GITLAB. The generator read any auth_type as a choice the node cannot make. But buildSourceConfig sends auth_type set to the source type with every platform secret, so for GitLab the node already names a scheme, and that scheme takes api_key, where the node already puts it. The generator now resolves a choice to the type's own scheme when one exists. That keeps GitLab as it was and turns Grafana from a bare "choice" into a refusal that names its three fields.

ShipStation and AWS SNS are verified with keys Hookdeck fetches itself. ShipStation has used its public JWKS since 3 October (core #5711); before that it took a public_key. But Hookdeck creates a source's verification only when the request carries auth, even {} (server/controllers/Source.ts in core). A source created without it accepts unsigned requests.

  • SNS: the node never sent auth, so every SNS source it created was unverified. Its refusal of a secret also told users "Hookdeck verifies this platform without one".
  • ShipStation on main: verified only when the user typed a public key. Hookdeck strips the key (it validates with Joi stripUnknown), but the auth object around it survives.

The spec cannot tell these two from Docker Hub or WordPress.com, which Hookdeck does not verify at all, because their auth schemas are identical. So the generator lists them in KEYLESS_VERIFICATION, and throws if the spec ever gives one fields, which the drift check then reports. {"auth": null} in Source Config (JSON) still turns verification off.

Google Pub/Sub. Hookdeck names schemas after labels, so "Google Pub/Sub" puts an unescaped / in its $ref (#/components/schemas/SourceConfigGooglePub/SubAuth). deref took the last path segment, found nothing, and read Pub/Sub as taking no secret. It now resolves the whole name.

Labels. Choice-of-scheme types carry no x-docs-type of their own, so GitLab would have regressed to "Gitlab" and SendGrid Inbound Parse would read "Sendgrid Inbound". Both are in LABEL_OVERRIDES. Pub/Sub's label now comes from the spec.

Wording. The none refusal no longer claims Hookdeck verifies those platforms or rejects a stray secret. The Webhook Secret description no longer says an empty field always skips verification.

How this was established

  1. First Integration run on this PR: the old ShipStation check asserted Hookdeck rejects auth: { public_key }. Hookdeck accepted it, so the none reading was unproven.
  2. Hookdeck core (origin/master and staging):
    • The request validator strips unknown fields.
    • Source.ts only creates an integration when auth is present.
    • Ingestion skips verification for a source with no integration.
    • authenticated in the source response is !!source.verification.
    • Only AWS_SNS and SHIPSTATION have a verification feature with no fields.
  3. The new live check provisions SNS and ShipStation through the trigger and asserts authenticated: true. As a control, a bare source of each type created without auth must report false. This run is where that is proven against the API.

Tests

  • Unit (120): new tests cover:
    • how a choice resolves (GitLab → api_key; Azure Event Grid and SendGrid Inbound Parse stay choice)
    • the two labels
    • the Pub/Sub $ref
    • keyless types sending auth: {}, refusing a secret, and opting out with {"auth": null}
  • Live (api.test.mjs): GitLab's request is accepted, and keyless sources report authenticated against a bare control.

Verification

  • npm run build, 120 unit tests, npm run lint (0 errors; the 2 icon warnings are already on main), npm run scan, verify-package-load.mjs and npm run check:source-types (186 types) all pass locally.
  • Not run locally: the live suites. The first Integration run passed the GitLab check and failed the old ShipStation one. This push replaces that check.
  • Prettier flags files main already fails on. None of the flagged lines are ones this PR adds.

Not in this PR

  • Stripe trap test is half-true. The live test "a configured platform source is indistinguishable from a bare one" says only an unsigned delivery can tell them apart. That holds for config, but core's top-level authenticated should differ. That part is unverified here; it could fix the README trap section.
  • No timeout-minutes in any workflow, which is why the 19 October hang ran for 6 hours.
  • The drift check fails silently (owner email only), which is how 9 weeks went unnoticed.
  • 502 bodies reach users verbatim. A 502 from Hookdeck arrives as a full Cloudflare HTML page, because describeHookdeckPayload returns text bodies as they are.
  • Upstream, for core:
    • The spec's unescaped / in schema names.
    • additionalProperties: false in the spec while the API strips silently.
    • Keyless verification being opt-in through an empty auth, which nothing in the spec tells an API user.

🤖 Generated with Claude Code

leggetter and others added 2 commits October 20, 2026 11:15
The weekly drift check has failed every run since it was added on 17 August,
so the Source Type dropdown has been missing every platform Hookdeck added
since: 35 of them as of today, 151 types offered against 186 supported.

Regenerating was not enough on its own. GitLab's auth schema gained an
`auth_type` with a choice of Standard Webhooks or GitLab's own scheme, and the
generator read any `auth_type` as "a choice the node cannot make", which would
have made the node refuse a GitLab Webhook Secret outright. But the node sends
`auth_type` set to the source type with every platform secret, so for GitLab
it already names a scheme, and the spec puts that scheme's secret in
`api_key`, where the node already sends it. The generator now resolves a
choice to the type's own scheme when one exists, which leaves GitLab exactly
as it was and gives Grafana field-level guidance instead of a bare "choice".

ShipStation went the other way. Its auth schema became an empty object that
admits no properties, so the `public_key` the node used to send now has
nowhere to go. It regenerates as taking no secret, and the node refuses one
before publish, with a message, instead of passing on a rejection from Hookdeck.

Choice-of-scheme types carry no `x-docs-type`, so GitLab's label silently
regressed to "Gitlab" and two new types came out as "Google Pubsub" and
"Sendgrid Inbound". They are overridden alongside the existing exceptions.

The live suite gains two checks so the claims above rest on the API rather
than on the spec: that Hookdeck accepts the GitLab request the node sends,
and that it rejects the ShipStation request the node used to send.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first commit read ShipStation's now-empty auth schema as "takes no
secret", and its live check asserted Hookdeck rejects the public_key the
node used to send. Hookdeck accepted it. Hookdeck's own code explains why,
and shows that "takes no secret" was the wrong reading in a way that leaves
sources unverified.

Hookdeck validates requests with Joi's stripUnknown, so a field it does not
expect is dropped rather than rejected. The public_key vanished; the `auth`
object around it did not, and that object is what matters: Hookdeck creates
a source's verification only when the request carries `auth`, even `{}`.
ShipStation (keys from its public JWKS since 3 October) and AWS SNS (signing
certificate named in each message) are verified with keys Hookdeck fetches
itself, so they have nothing to enter. Created without `auth`, they get no
verification and accept unsigned requests.

The node never sent `auth` for AWS SNS, classed as "none" since August, and
its refusal of a secret told users Hookdeck verified the platform without
one. On main, ShipStation was verified only if the user typed a public key
Hookdeck no longer reads. With the first commit it would never have been.

The spec cannot tell these two apart from Docker Hub or WordPress.com, which
Hookdeck does not verify at all: the auth schemas are identical. So the
generator lists them as `keyless`, and throws if the spec ever gives one of
them fields, which the weekly drift check will then report. The node sends
`auth: {}` for them when Webhook Secret is empty, and Source Config (JSON)
of {"auth": null} still turns verification off.

Google Pub/Sub was misread too. Hookdeck names schemas after labels, so
"Google Pub/Sub" puts an unescaped slash in its $ref, and `deref` looked up
the last path segment, "SubAuth", which does not exist. Pub/Sub requires
`audience` and `service_account_email`, and now says so. Its label comes
from the same schema, so its override goes.

The refusal for "none" types no longer claims Hookdeck verifies them or
rejects a stray secret, and the Webhook Secret description no longer says
an empty field always skips verification.

The live check now provisions both types through the trigger and asserts the
source reports `authenticated: true`, against a bare source of the same type
that should report false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leggetter
leggetter merged commit c77117d into main Oct 22, 2026
2 checks passed
leggetter added a commit that referenced this pull request Nov 5, 2026
…tform needs a secret (#35)

Issue #12 asked for a note on how n8n stores the key and whether there is
a route other than pasting it into the editor, because that is the first
question a security review asks and the Cloud and self-hosted answers
differ. It proposed saying there is no environment-variable route. Checked
against n8n 2.44.6's source, there is one: CREDENTIALS_OVERWRITE_DATA fills
a credential field from the environment without storing it in the
credential, and the editor then hides that field. That pins every Hookdeck
credential made in the editor to one project, which the docs now say.

So Getting started lists what does work, with its catch: external secrets
($secrets, Enterprise on Cloud and self-hosted), credential overwrites on
self-hosted, and the public API or `n8n import:credentials` for scripted
setups. It also says why `$env` is not on the list: n8n 2.x blocks it unless
N8N_BLOCK_ENV_ACCESS_IN_NODE=false, which reopens environment access to
every node on the instance, and Cloud has no environment to read.

Separately, four places told users verification needs a Webhook Secret. That
stopped being true when #33 had the node switch verification on for AWS SNS
and ShipStation, which Hookdeck verifies with keys it fetches itself. The
README security model, Getting started, Security and the trigger reference
now name the exception.

Closes #12.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leggetter leggetter mentioned this pull request Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant